import http from '@/utils/request'
import { api } from '@/api/api'
function loginReq(loginname, password) {
  return http({
    method: 'post',
    url: api.loginApi,
    data: { loginname, password },
  })
}
function userDataReq(userid) {
  return http({
    method: 'get',
    url: api.getUserDataApi,
    params: { userid },
  })
}
function nameRegReq(loginname, password) {
  return http({
    method: 'post',
    url: api.nameRegApi,
    data: { loginname, password },
  })
}
function telRegReq(tel, password) {
  return http({
    method: 'post',
    url: api.telRegApi,
    data: { tel, password },
  })
}
function updatePasswordReq(userid, oldpassword, newpassword) {
  return http({
    method: 'get',
    url: api.updatePasswordApi,
    params: { userid, oldpassword, newpassword },
  })
}
function bindUserAvatarReq(userid, avatar) {
  return http({
    method: 'get',
    url: api.getBindUserAvatarApi,
    params: { userid, avatar },
  })
}
export { loginReq, userDataReq, nameRegReq, telRegReq, updatePasswordReq, bindUserAvatarReq }
